package com.siloam.vo;

import com.siloam.module.Role;

public class RoleVO {
	private int id;
	private String name;
	private String scope;
	private String remark;
	private String opt;
	
	public RoleVO(){
		
	}
	
	public RoleVO(Role role){
		setId(role.getId());
		setName(role.getName());
		setScope(role.getScopeText());
		setRemark(role.getRemark());
		setOptText(role.getScope());
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getScope() {
		return scope;
	}
	public void setScope(String scope) {
		this.scope = scope;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getOpt() {
		return opt;
	}
	public void setOpt(String opt) {
		this.opt = opt;
	}
	public void setOptText(int scope){
		StringBuffer sb = new StringBuffer();
		sb.append("<a href='javascript:roleNavs(")
			.append(id)
			.append(")' class='opt-img'>")
			.append("<img src='../../jeasyui/themes/icons/menu.png'/></a>");
		if(scope == Role.SCOPE_ALL){
			sb.append("<span class='opt-span'></span>");
		} else if(scope == Role.SCOPE_SPECIAL){
			sb.append("<a href='#' class='opt-img'>")
				.append("<img src='../../jeasyui/themes/icons/users.png'></a>");
		}
		opt = sb.toString();
	}

}
